Add a couple of well chosen assertions to new context
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 16 Aug 2005 18:12:19 +0000 (18:12 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 16 Aug 2005 18:12:19 +0000 (18:12 +0000)
switch code.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/domain.c

index 7df964347b5043e05f45624151553537d45663b8..ad8716aac663aa88b96b787d12c428072779385c 100644 (file)
@@ -815,6 +815,8 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 {
     unsigned int cpu = smp_processor_id();
 
+    ASSERT(!local_irq_is_enabled());
+
     set_current(next);
 
     if ( (percpu_ctxt[cpu].curr_vcpu != next) && !is_idle_task(next->domain) )
@@ -828,6 +830,8 @@ void context_switch_finalise(struct vcpu *next)
 {
     unsigned int cpu = smp_processor_id();
 
+    ASSERT(local_irq_is_enabled());
+
     if ( percpu_ctxt[cpu].context_not_finalised )
     {
         percpu_ctxt[cpu].context_not_finalised = 0;